<!-- 添加学生 -->
<template>
  <div class="all">
    <el-card>
      <strong>修改密码</strong>
      <el-descriptions class="margin-top" :column="1" style="margin-top: 20px" border>

        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-user"></i>
            旧密码
          </template>
          <el-input></el-input>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-mobile-phone"></i>
            新密码
          </template>
          <el-input ></el-input>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-tickets"></i>
            确认密码
          </template>
          <el-input  show-password ></el-input>
        </el-descriptions-item>


      </el-descriptions>

      <el-button type="primary" class="change-btn" >确认</el-button>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: { //表单数据初始化
        studentName: null,
        grade: null,
        major: null,
        clazz: null,
        institute: null,
        tel: null,
        email: null,
        pwd: null,
        cardId: null,
        sex: null,
        role: 2
      }
    };
  },
  methods: {
    onSubmit() { //数据提交
      this.$axios({
        url: '/api/student',
        method: 'post',
        data: {
          ...this.form
        }
      }).then(res => {
        if(res.data.code == 200) {
          this.$message({
            message: '数据添加成功',
            type: 'success'
          })
          this.$router.push({path: '/studentManage'})
        }
      })
    },
    cancel() { //取消按钮
      this.form = {}
    },

  }
};
</script>
<style lang="less" scoped>
.all {
  padding: 0px 40px;
  .page {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .edit {
    margin-left: 20px;
  }
  .el-table tr {
    background-color: #dd5862 !important;
  }
}
.add {
  padding: 0px 40px;
  width: 400px;
}
.change-btn{
  margin-left: 45%;
  margin-top: 20px;
  width: 100px
}
</style>

